package com.admin.domain.service;

import com.admin.domain.modle.Member;
import com.admin.domain.repository.MemberRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WeChatMemberService {
    @Autowired
    private MemberRepository memberRepository;

    /**
     * 更新或者删除用户
     *
     * @param member
     * @return
     */
    public Member upsertMember(Member member) {
        if (member == null) {
            throw new IllegalArgumentException("member not be empty");
        }
        return memberRepository.upsert(member);
    }
}
